<template>
	<view class="pet">
		<view class="p1">
			<u-grid col="5">
				<u-grid-item v-for="item in type" style="margin-top: 20px;" @click="todoctor(item.id)">
					<image :src="'http://124.93.196.45:10001'+item.imgUrl" style="width: 50px; height: 50px;"></image>
					<text>{{item.name}}</text>
				</u-grid-item>
			</u-grid>
		</view>
		<u-line></u-line>
		<u-tabbar>
			<u-tabbar-item text="宠物种类" icon="home-fill"></u-tabbar-item>
			<u-tabbar-item text="我的问诊" icon="hourglass" @click="tomy"></u-tabbar-item>
			<u-tabbar-item text="问诊列表" icon="tags" @click="tolist"></u-tabbar-item>
		</u-tabbar>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				type:[]
			}
		},
		onLoad() {
			this.gettype()
		},
		methods: {
			gettype(){
				this.api.get('/prod-api/api/pet-hospital/pet-type/list').then(res=>{
					this.type=res.data.data
				})
			},
			tomy(){
				uni.redirectTo({
					url:'/pages/other/pethospital/mywenzhen/mywenzhen'
				})
			},
			tolist(){
				uni.redirectTo({
					url:'/pages/other/pethospital/wenzhenlist/wenzhenlist'
				})
			},
			todoctor(id){
				console.log(id)
				uni.navigateTo({
					url:'/pages/other/pethospital/findDoctor/findDoctor?id='+id
				})
			}
		}
	}
</script>

<style>

</style>
